<template>
    <div class="login-container">
        <div class="login-cards">
            <!-- 左侧插图区域 -->
            <div class="illustration-section">
                <div class="logo">
                    <!-- <img src="../assets/logo2.png" alt="Nextacks Logo" /> -->
                </div>
            </div>

            <!-- 右侧登录表单 -->
            <div class="login-form-section">
                <div class="login-form-container">
                    <h1>HI!欢迎使用云HIS系统</h1>
                    <p class="subtitle">方便 | 快捷 | 便捷</p>

                    <form @submit.prevent="handleSubmit">
                        <div class="form-group">
                            <label>系统账号</label>
                            <input type="email" v-model="email" placeholder="请输入系统账号" required />
                        </div>

                        <div class="form-group">
                            <label>系统密码</label>
                            <div class="password-input">
                                <input :type="showPassword ? 'text' : 'password'" v-model="password"
                                    placeholder="请输入系统密码" required />
                                <button type="button" class="toggle-password" @click="togglePassword">
                                    <i class="fas" :class="showPassword ? 'fa-eye-slash' : 'fa-eye'"></i>
                                </button>
                            </div>
                        </div>

                        <button type="submit" class="sign-in-btn">登录系统</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="footer">
            <span>Copyright © 2006-2025 <a href="#">黑龙江若康科技有限公司</a></span>
        </div>
    </div>
</template>

<script setup>
import { ref } from "vue";

const email = ref("");
const password = ref("");
const showPassword = ref(false);
const rememberMe = ref(false);

const handleSubmit = () => {
    console.log("Form submitted:", {
        email: email.value,
        password: password.value,
        rememberMe: rememberMe.value,
    });
};

const togglePassword = () => {
    showPassword.value = !showPassword.value;
};
</script>

<style scoped lang="less">
.footer{
position: absolute;
width: 100%;
text-align: center;
height: 40px;
line-height: 40px;
bottom: 0;
span{
    font-size: 14px;
    a{
        color: #6366f1;
        text-decoration: none;
    }
}
}
.login-container {
    width: 100%;
    height: 100vh;
    // background-color: #1a1a1a;
    background-image: url("../assets/968.png");
    background-size: cover;
    background-position: center;
    position: fixed;
    top: 0px;
    left: 0px;
    align-items: center;
    justify-content: center;
    display: flex;

    .login-cards {
        width: 1000px;
        display: flex;
        height: 500px;
        background-color: #fff;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 10px 20px 0px rgba(0, 0, 0, 0.13);
    }
}

.illustration-section {
    background-image: url("../assets/login1.png");
    background-size: cover;
    background-position: center;
    flex: 1.5;
    background-color: #f8f9ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.main-illustration {
    max-width: 80%;
    height: auto;
}

.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

h1 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    label{
        font-size: 14px;
        color: #666;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-weight: 500;
    text-align: left;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: #6366f1;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forgot-password {
    color: #6366f1;
    text-decoration: none;
}

.sign-in-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sign-in-btn:hover {
    background-color: #4f46e5;
}

.social-login {
    margin-top: 2rem;
    text-align: center;
}

.social-login p {
    color: #666;
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.social-btn:hover {
    background-color: #f8f9ff;
}

.signup-prompt {
    margin-top: 2rem;
    color: #666;
    text-align: center;
}

.signup-prompt a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .illustration-section {
        display: none;
    }

    .login-form-section {
        padding: 1rem;
    }
}
</style>
